package com.leyou;


import com.leyou.common.vo.PageResult;
import com.leyou.dto.PermissionDTO;
import com.leyou.dto.RoleDTO;
import com.leyou.dto.UserManageDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient("user-mservice")
public interface UserManageClient {
    @GetMapping("/queryRole")
    public List<RoleDTO> queryRoles();

    @GetMapping("/page")
    public PageResult<UserManageDTO> queryUserManageByPage(
            @RequestParam(value = "page",defaultValue = "1")Integer page,
            @RequestParam(value = "rows",defaultValue = "5"  )Integer rows
    );

    //添加员工信息
    @PostMapping("/member")
    public Void addUserManage(@RequestBody UserManageDTO userManageDTO);

    //修改员工信息
    @PutMapping("/member")
    public Void  updateUserManage(@RequestBody UserManageDTO userManageDTO);

    //根据uid查找user
    @GetMapping("/member/{id}")
    public UserManageDTO queryUserManageById(@PathVariable(value = "id") Long id);

    //删除员工信息
    @DeleteMapping("/member/{id}")
    public Void deleteUserManage(@PathVariable(value = "id")Long id);

    @GetMapping("/list/page")
    public PageResult<PermissionDTO> queryListByPage(
            @RequestParam(value = "page",defaultValue = "1")Integer page,
            @RequestParam(value = "rows",defaultValue = "5"  )Integer rows
    );
    @GetMapping("/list/of/parent")
    public List<PermissionDTO> findPermissionByParentId(@RequestParam("pid") Long pid);

    @GetMapping("/list/of/children")
    public List<PermissionDTO> findPermissionById(@RequestParam("pid") Long pid);

}
